﻿using System.Configuration;
using Framework;

namespace Enterprise
{
    public class ProductConfig : ConfigService
    {
        static ProductConfig()
        {
            ThumbnailWidth = ConfigurationManager.AppSettings["ProductThumbnailWidth"].SafeToInt();
            ThumbnailHeight = ConfigurationManager.AppSettings["ProductThumbnailHeight"].SafeToInt();
            ThumbnailPrefix = ConfigurationManager.AppSettings["ProductThumbnailPrefix"].SafeToString();
            ImageSize = ConfigurationManager.AppSettings["ProductImageSize"].SafeToInt();
            NormalWidth = ConfigurationManager.AppSettings["ProductNormalWidth"].SafeToInt();
            NormalHeight = ConfigurationManager.AppSettings["ProductNormalHeight"].SafeToInt();
            NormalPrefix = ConfigurationManager.AppSettings["ProductNormalPrefix"].SafeToString();
            IsWaterMark = ConfigurationManager.AppSettings["IsProductWaterMark"].SafeToBool();
            WaterMarkFileName = ConfigurationManager.AppSettings["ProductWaterMarkFileName"].SafeToString();
            WaterMarkRelativePath = ConfigurationManager.AppSettings["ProductWaterMarkRelativePath"].SafeToString();
            IsGenerateThumbnail = ConfigurationManager.AppSettings["IsProductGenerateThumbnail"].SafeToBool();
            IsGenerateNormal = ConfigurationManager.AppSettings["IsProductGenerateNormal"].SafeToBool();
            IsAdaptive = ConfigurationManager.AppSettings["IsProductImageAdaptive"].SafeToBool();
            RelativePath = ConfigurationManager.AppSettings["ProductImageRelativePath"].SafeToString();
        }
        public new static int ThumbnailWidth { get; set; }

        public new static int ThumbnailHeight { get; set; }

        public new static int ImageSize { get; set; }

        public new static bool IsGenerateThumbnail { get; set; }

        public new static string ThumbnailPrefix { get; set; }

        public new static bool IsWaterMark { get; set; }

        public new static string RelativePath { get; set; }

        public new static string WaterMarkFileName { get; set; }

        public new static string WaterMarkRelativePath { get; set; }

        public new static bool IsGenerateNormal { get; set; }

        public new static bool IsAdaptive { get; set; }

        public new static int NormalWidth { get; set; }

        public new static int NormalHeight { get; set; }

        public new static string NormalPrefix { get; set; }

        }
}
